<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: option.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('option_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">option.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;coap_config.h&quot;</code><br />
<code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &quot;<a class="el" href="libcoap_8h_source.html">libcoap.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="option_8h_source.html">option.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="encode_8h_source.html">encode.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="coap__debug_8h_source.html">coap_debug.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mem_8h_source.html">mem.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="utlist_8h_source.html">utlist.h</a>&quot;</code><br />
</div>
<p><a href="option_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structopt__filter.html">opt_filter</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aa97d453559cd009ef64585357f891d4b" id="r_aa97d453559cd009ef64585357f891d4b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#aa97d453559cd009ef64585357f891d4b">ADVANCE_OPT</a>(o,  e,  step)</td></tr>
<tr class="separator:aa97d453559cd009ef64585357f891d4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a553720c443388c45dcc81cf5a3e2979f" id="r_a553720c443388c45dcc81cf5a3e2979f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a553720c443388c45dcc81cf5a3e2979f">ADVANCE_OPT_CHECK</a>(o,  e,  step)</td></tr>
<tr class="separator:a553720c443388c45dcc81cf5a3e2979f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:affc9e344d152d043d3039a014f867dd3" id="r_affc9e344d152d043d3039a014f867dd3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#affc9e344d152d043d3039a014f867dd3">LONG_MASK</a>&#160;&#160;&#160;((1 &lt;&lt; <a class="el" href="group__opt__filter.html#gab098c0305af7c474b5cd79e4204cfb40">COAP_OPT_FILTER_LONG</a>) - 1)</td></tr>
<tr class="separator:affc9e344d152d043d3039a014f867dd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e60b801f6361b8c606aa2b3078c8b7c" id="r_a5e60b801f6361b8c606aa2b3078c8b7c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a5e60b801f6361b8c606aa2b3078c8b7c">SHORT_MASK</a>&#160;&#160;&#160;  (~<a class="el" href="option_8c.html#affc9e344d152d043d3039a014f867dd3">LONG_MASK</a> &amp; ((1 &lt;&lt; (<a class="el" href="group__opt__filter.html#gab098c0305af7c474b5cd79e4204cfb40">COAP_OPT_FILTER_LONG</a> + <a class="el" href="group__opt__filter.html#ga7bb991b46f70311754e632738d33266b">COAP_OPT_FILTER_SHORT</a>)) - 1))</td></tr>
<tr class="separator:a5e60b801f6361b8c606aa2b3078c8b7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a2e47362612316659297d3c87fb779187" id="r_a2e47362612316659297d3c87fb779187"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a2e47362612316659297d3c87fb779187">filter_op_t</a> { <a class="el" href="option_8c.html#a2e47362612316659297d3c87fb779187a60a196f7d75d979d5025f6638871136c">FILTER_SET</a>
, <a class="el" href="option_8c.html#a2e47362612316659297d3c87fb779187a1eaf5fbe94e40a0de737a3efb1eae47a">FILTER_CLEAR</a>
, <a class="el" href="option_8c.html#a2e47362612316659297d3c87fb779187a4f5c6c9055a46ce3a0a63033864eab4a">FILTER_GET</a>
 }</td></tr>
<tr class="memdesc:a2e47362612316659297d3c87fb779187"><td class="mdescLeft">&#160;</td><td class="mdescRight">Operation specifiers for coap_filter_op().  <a href="option_8c.html#a2e47362612316659297d3c87fb779187">More...</a><br /></td></tr>
<tr class="separator:a2e47362612316659297d3c87fb779187"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a11de99f50cc9f5a34fd9e4d121ecfd13" id="r_a11de99f50cc9f5a34fd9e4d121ecfd13"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a11de99f50cc9f5a34fd9e4d121ecfd13">coap_opt_parse</a> (const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt, size_t length, <a class="el" href="structcoap__option__t.html">coap_option_t</a> *result)</td></tr>
<tr class="memdesc:a11de99f50cc9f5a34fd9e4d121ecfd13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parses the option pointed to by <code>opt</code> into <code>result</code>.  <br /></td></tr>
<tr class="separator:a11de99f50cc9f5a34fd9e4d121ecfd13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa76930050882387b0f5c7d0246e14440" id="r_gaa76930050882387b0f5c7d0246e14440"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gaa76930050882387b0f5c7d0246e14440">coap_option_iterator_init</a> (const <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu, <a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *oi, const <a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter)</td></tr>
<tr class="memdesc:gaa76930050882387b0f5c7d0246e14440"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the given option iterator <code>oi</code> to point to the beginning of the <code>pdu's</code> option list.  <br /></td></tr>
<tr class="separator:gaa76930050882387b0f5c7d0246e14440"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70fa9db0450134640b80cbf7c3720688" id="r_a70fa9db0450134640b80cbf7c3720688"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a70fa9db0450134640b80cbf7c3720688">opt_finished</a> (<a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *oi)</td></tr>
<tr class="separator:a70fa9db0450134640b80cbf7c3720688"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga19d4dbbc03ef362996964fbfdd1d4c7b" id="r_ga19d4dbbc03ef362996964fbfdd1d4c7b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga19d4dbbc03ef362996964fbfdd1d4c7b">coap_option_next</a> (<a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *oi)</td></tr>
<tr class="memdesc:ga19d4dbbc03ef362996964fbfdd1d4c7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the iterator <code>oi</code> to point to the next option.  <br /></td></tr>
<tr class="separator:ga19d4dbbc03ef362996964fbfdd1d4c7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga35c348f1ce988e6788930a710f4535c9" id="r_ga35c348f1ce988e6788930a710f4535c9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga35c348f1ce988e6788930a710f4535c9">coap_check_option</a> (<a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu, uint16_t type, <a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *oi)</td></tr>
<tr class="memdesc:ga35c348f1ce988e6788930a710f4535c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the first option of type <code>type</code> from <code>pdu</code>.  <br /></td></tr>
<tr class="separator:ga35c348f1ce988e6788930a710f4535c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae6aced1ef1014a692f68b3a13c7d6b70" id="r_gae6aced1ef1014a692f68b3a13c7d6b70"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gae6aced1ef1014a692f68b3a13c7d6b70">coap_opt_delta</a> (const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt)</td></tr>
<tr class="memdesc:gae6aced1ef1014a692f68b3a13c7d6b70"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decodes the delta value of the next option.  <br /></td></tr>
<tr class="separator:gae6aced1ef1014a692f68b3a13c7d6b70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac65919c93f7047b687d33af9672b3ea" id="r_gaac65919c93f7047b687d33af9672b3ea"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gaac65919c93f7047b687d33af9672b3ea">coap_opt_length</a> (const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt)</td></tr>
<tr class="memdesc:gaac65919c93f7047b687d33af9672b3ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the length of the given option.  <br /></td></tr>
<tr class="separator:gaac65919c93f7047b687d33af9672b3ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaec4e944d39722779cac610ed22ee09db" id="r_gaec4e944d39722779cac610ed22ee09db"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gaec4e944d39722779cac610ed22ee09db">coap_opt_value</a> (const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt)</td></tr>
<tr class="memdesc:gaec4e944d39722779cac610ed22ee09db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the value of the given option.  <br /></td></tr>
<tr class="separator:gaec4e944d39722779cac610ed22ee09db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a683c0121b4028a90f612809437aaa3d0" id="r_a683c0121b4028a90f612809437aaa3d0"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a683c0121b4028a90f612809437aaa3d0">coap_opt_size</a> (const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt)</td></tr>
<tr class="memdesc:a683c0121b4028a90f612809437aaa3d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the size of the given option, taking into account a possible option jump.  <br /></td></tr>
<tr class="separator:a683c0121b4028a90f612809437aaa3d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafebbd04a7895df694a9345dad0275aeb" id="r_gafebbd04a7895df694a9345dad0275aeb"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#gafebbd04a7895df694a9345dad0275aeb">coap_opt_setheader</a> (<a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt, size_t maxlen, uint16_t delta, size_t length)</td></tr>
<tr class="memdesc:gafebbd04a7895df694a9345dad0275aeb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encodes the given delta and length values into <code>opt</code>.  <br /></td></tr>
<tr class="separator:gafebbd04a7895df694a9345dad0275aeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga55f19454026048e906139d575feddecb" id="r_ga55f19454026048e906139d575feddecb"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga55f19454026048e906139d575feddecb">coap_opt_encode_size</a> (uint16_t delta, size_t length)</td></tr>
<tr class="memdesc:ga55f19454026048e906139d575feddecb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute storage bytes needed for an option with given <code>delta</code> and <code>length</code>.  <br /></td></tr>
<tr class="separator:ga55f19454026048e906139d575feddecb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga358cb455deaefca1b1234298f018c9ab" id="r_ga358cb455deaefca1b1234298f018c9ab"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga358cb455deaefca1b1234298f018c9ab">coap_opt_encode</a> (<a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *opt, size_t maxlen, uint16_t delta, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *val, size_t length)</td></tr>
<tr class="memdesc:ga358cb455deaefca1b1234298f018c9ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encodes option with given <code>delta</code> into <code>opt</code>.  <br /></td></tr>
<tr class="separator:ga358cb455deaefca1b1234298f018c9ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2be7abc95dd3dfc1f1f3f4268ce41101" id="r_a2be7abc95dd3dfc1f1f3f4268ce41101"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a2be7abc95dd3dfc1f1f3f4268ce41101">is_long_option</a> (uint16_t type)</td></tr>
<tr class="memdesc:a2be7abc95dd3dfc1f1f3f4268ce41101"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true iff <code>type</code> denotes an option type larger than 255.  <br /></td></tr>
<tr class="separator:a2be7abc95dd3dfc1f1f3f4268ce41101"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4225eb8945afcd42e9d4c50bd7c85ff1" id="r_a4225eb8945afcd42e9d4c50bd7c85ff1"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a4225eb8945afcd42e9d4c50bd7c85ff1">coap_option_filter_op</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter, uint16_t type, enum <a class="el" href="option_8c.html#a2e47362612316659297d3c87fb779187">filter_op_t</a> op)</td></tr>
<tr class="memdesc:a4225eb8945afcd42e9d4c50bd7c85ff1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Applies <code>op</code> on <code>filter</code> with respect to <code>type</code>.  <br /></td></tr>
<tr class="separator:a4225eb8945afcd42e9d4c50bd7c85ff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0170aecd699295f02affd5b280244088" id="r_ga0170aecd699295f02affd5b280244088"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga0170aecd699295f02affd5b280244088">coap_option_filter_set</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter, uint16_t type)</td></tr>
<tr class="memdesc:ga0170aecd699295f02affd5b280244088"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the corresponding entry for <code>type</code> in <code>filter</code>.  <br /></td></tr>
<tr class="separator:ga0170aecd699295f02affd5b280244088"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga61706c7da445795c096cb21194b57bb3" id="r_ga61706c7da445795c096cb21194b57bb3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga61706c7da445795c096cb21194b57bb3">coap_option_filter_unset</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter, uint16_t type)</td></tr>
<tr class="memdesc:ga61706c7da445795c096cb21194b57bb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the corresponding entry for <code>type</code> in <code>filter</code>.  <br /></td></tr>
<tr class="separator:ga61706c7da445795c096cb21194b57bb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d3a4336ff55e111eae4eb2a1883a98b" id="r_ga3d3a4336ff55e111eae4eb2a1883a98b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__opt__filter.html#ga3d3a4336ff55e111eae4eb2a1883a98b">coap_option_filter_get</a> (<a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> filter, uint16_t type)</td></tr>
<tr class="memdesc:ga3d3a4336ff55e111eae4eb2a1883a98b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if <code>type</code> is contained in <code>filter</code>.  <br /></td></tr>
<tr class="separator:ga3d3a4336ff55e111eae4eb2a1883a98b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21df6c3988187909d52a3218eb2f12ef" id="r_a21df6c3988187909d52a3218eb2f12ef"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a21df6c3988187909d52a3218eb2f12ef">coap_new_optlist</a> (uint16_t number, size_t length, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data)</td></tr>
<tr class="memdesc:a21df6c3988187909d52a3218eb2f12ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new optlist entry.  <br /></td></tr>
<tr class="separator:a21df6c3988187909d52a3218eb2f12ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad773b314b1ac7591f38f7b4b04d9e68d" id="r_ad773b314b1ac7591f38f7b4b04d9e68d"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#ad773b314b1ac7591f38f7b4b04d9e68d">order_opts</a> (void *a, void *b)</td></tr>
<tr class="separator:ad773b314b1ac7591f38f7b4b04d9e68d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08d1a8011577258adfd93d1754becc3e" id="r_a08d1a8011577258adfd93d1754becc3e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a08d1a8011577258adfd93d1754becc3e">coap_add_optlist_pdu</a> (<a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu, <a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> **options)</td></tr>
<tr class="memdesc:a08d1a8011577258adfd93d1754becc3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The current optlist of <code>optlist_chain</code> is first sorted (as per RFC7272 ordering requirements) and then added to the <code>pdu</code>.  <br /></td></tr>
<tr class="separator:a08d1a8011577258adfd93d1754becc3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeafe92535dab93d60c42e586655d2843" id="r_aeafe92535dab93d60c42e586655d2843"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#aeafe92535dab93d60c42e586655d2843">coap_insert_optlist</a> (<a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> **head, <a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> *node)</td></tr>
<tr class="memdesc:aeafe92535dab93d60c42e586655d2843"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds <code>optlist</code> to the given <code>optlist_chain</code>.  <br /></td></tr>
<tr class="separator:aeafe92535dab93d60c42e586655d2843"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f99f0a8dd81b5ee7824871ebfc384d7" id="r_a7f99f0a8dd81b5ee7824871ebfc384d7"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#a7f99f0a8dd81b5ee7824871ebfc384d7">coap_internal_delete</a> (<a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> *node)</td></tr>
<tr class="separator:a7f99f0a8dd81b5ee7824871ebfc384d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4f857fc9a66eb154efe38d819328102" id="r_ac4f857fc9a66eb154efe38d819328102"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="option_8c.html#ac4f857fc9a66eb154efe38d819328102">coap_delete_optlist</a> (<a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> *queue)</td></tr>
<tr class="memdesc:ac4f857fc9a66eb154efe38d819328102"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all entries from the <code>optlist_chain</code>, freeing off their memory usage.  <br /></td></tr>
<tr class="separator:ac4f857fc9a66eb154efe38d819328102"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="aa97d453559cd009ef64585357f891d4b" name="aa97d453559cd009ef64585357f891d4b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa97d453559cd009ef64585357f891d4b">&#9670;&#160;</a></span>ADVANCE_OPT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ADVANCE_OPT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">o, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">e, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">step&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    <span class="keywordflow">if</span> ((e) &lt; step) {           \</div>
<div class="line">    coap_log(<a class="code hl_enumvalue" href="group__logging.html#gga53c7b97a7af4d62d8c1678d658cc7446ab9f002c6ffbfd511da8090213227454e">LOG_DEBUG</a>, <span class="stringliteral">&quot;cannot advance opt past end\n&quot;</span>); \</div>
<div class="line">    <span class="keywordflow">return</span> 0;                                             \</div>
<div class="line">  } <span class="keywordflow">else</span> {                                                \</div>
<div class="line">    (e) -= step;                                          \</div>
<div class="line">    (o) = ((o)) + step;                                   \</div>
<div class="line">  }</div>
<div class="ttc" id="agroup__logging_html_gga53c7b97a7af4d62d8c1678d658cc7446ab9f002c6ffbfd511da8090213227454e"><div class="ttname"><a href="group__logging.html#gga53c7b97a7af4d62d8c1678d658cc7446ab9f002c6ffbfd511da8090213227454e">LOG_DEBUG</a></div><div class="ttdeci">@ LOG_DEBUG</div><div class="ttdoc">Debug.</div><div class="ttdef"><b>Definition</b> <a href="coap__debug_8h_source.html#l00050">coap_debug.h:49</a></div></div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00027">27</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="a553720c443388c45dcc81cf5a3e2979f" name="a553720c443388c45dcc81cf5a3e2979f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a553720c443388c45dcc81cf5a3e2979f">&#9670;&#160;</a></span>ADVANCE_OPT_CHECK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ADVANCE_OPT_CHECK</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">o, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">e, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">step&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    <span class="keywordflow">do</span> { \</div>
<div class="line">    ADVANCE_OPT(o,e,step);               \</div>
<div class="line">    if ((e) &lt; 1)                         \</div>
<div class="line">      <span class="keywordflow">return</span> 0;                          \</div>
<div class="line">  } <span class="keywordflow">while</span> (0)</div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00039">39</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="affc9e344d152d043d3039a014f867dd3" name="affc9e344d152d043d3039a014f867dd3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#affc9e344d152d043d3039a014f867dd3">&#9670;&#160;</a></span>LONG_MASK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LONG_MASK&#160;&#160;&#160;((1 &lt;&lt; <a class="el" href="group__opt__filter.html#gab098c0305af7c474b5cd79e4204cfb40">COAP_OPT_FILTER_LONG</a>) - 1)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00439">439</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="a5e60b801f6361b8c606aa2b3078c8b7c" name="a5e60b801f6361b8c606aa2b3078c8b7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e60b801f6361b8c606aa2b3078c8b7c">&#9670;&#160;</a></span>SHORT_MASK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SHORT_MASK&#160;&#160;&#160;  (~<a class="el" href="option_8c.html#affc9e344d152d043d3039a014f867dd3">LONG_MASK</a> &amp; ((1 &lt;&lt; (<a class="el" href="group__opt__filter.html#gab098c0305af7c474b5cd79e4204cfb40">COAP_OPT_FILTER_LONG</a> + <a class="el" href="group__opt__filter.html#ga7bb991b46f70311754e632738d33266b">COAP_OPT_FILTER_SHORT</a>)) - 1))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00440">440</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a2e47362612316659297d3c87fb779187" name="a2e47362612316659297d3c87fb779187"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e47362612316659297d3c87fb779187">&#9670;&#160;</a></span>filter_op_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="option_8c.html#a2e47362612316659297d3c87fb779187">filter_op_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Operation specifiers for coap_filter_op(). </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a2e47362612316659297d3c87fb779187a60a196f7d75d979d5025f6638871136c" name="a2e47362612316659297d3c87fb779187a60a196f7d75d979d5025f6638871136c"></a>FILTER_SET&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a2e47362612316659297d3c87fb779187a1eaf5fbe94e40a0de737a3efb1eae47a" name="a2e47362612316659297d3c87fb779187a1eaf5fbe94e40a0de737a3efb1eae47a"></a>FILTER_CLEAR&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a2e47362612316659297d3c87fb779187a4f5c6c9055a46ce3a0a63033864eab4a" name="a2e47362612316659297d3c87fb779187a4f5c6c9055a46ce3a0a63033864eab4a"></a>FILTER_GET&#160;</td><td class="fielddoc"></td></tr>
</table>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00452">452</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a08d1a8011577258adfd93d1754becc3e" name="a08d1a8011577258adfd93d1754becc3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a08d1a8011577258adfd93d1754becc3e">&#9670;&#160;</a></span>coap_add_optlist_pdu()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_add_optlist_pdu </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>pdu</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> **&#160;</td>
          <td class="paramname"><em>optlist_chain</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The current optlist of <code>optlist_chain</code> is first sorted (as per RFC7272 ordering requirements) and then added to the <code>pdu</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pdu</td><td>The pdu to add the options to from the chain list </td></tr>
    <tr><td class="paramname">optlist_chain</td><td>The chained list of optlist to add to the pdu</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if succesful or <code>0</code> if failure; </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00584">584</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="ac4f857fc9a66eb154efe38d819328102" name="ac4f857fc9a66eb154efe38d819328102"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4f857fc9a66eb154efe38d819328102">&#9670;&#160;</a></span>coap_delete_optlist()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_delete_optlist </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> *&#160;</td>
          <td class="paramname"><em>optlist_chain</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes all entries from the <code>optlist_chain</code>, freeing off their memory usage. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">optlist_chain</td><td>The optlist chain to remove all the entries from </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00621">621</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="aeafe92535dab93d60c42e586655d2843" name="aeafe92535dab93d60c42e586655d2843"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeafe92535dab93d60c42e586655d2843">&#9670;&#160;</a></span>coap_insert_optlist()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_insert_optlist </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> **&#160;</td>
          <td class="paramname"><em>optlist_chain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> *&#160;</td>
          <td class="paramname"><em>optlist</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds <code>optlist</code> to the given <code>optlist_chain</code>. </p>
<p>The optlist_chain variable be set to NULL before the initial call to <a class="el" href="option_8h.html#ad867c028a9dc7b4be543223cc685c57c" title="Adds optlist to the given optlist_chain.">coap_insert_optlist()</a>. The optlist_chain will need to be deleted using <a class="el" href="option_8h.html#a476a30348f07ce45d0e1a3be0d1a1c21" title="Removes all entries from the optlist_chain, freeing off their memory usage.">coap_delete_optlist()</a> when no longer required.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">optlist_chain</td><td>The chain to add optlist to </td></tr>
    <tr><td class="paramname">optlist</td><td>The optlist to add to the queue</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if successful, <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00600">600</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="a7f99f0a8dd81b5ee7824871ebfc384d7" name="a7f99f0a8dd81b5ee7824871ebfc384d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7f99f0a8dd81b5ee7824871ebfc384d7">&#9670;&#160;</a></span>coap_internal_delete()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int coap_internal_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> *&#160;</td>
          <td class="paramname"><em>node</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00613">613</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="a21df6c3988187909d52a3218eb2f12ef" name="a21df6c3988187909d52a3218eb2f12ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a21df6c3988187909d52a3218eb2f12ef">&#9670;&#160;</a></span>coap_new_optlist()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__optlist__t.html">coap_optlist_t</a> * coap_new_optlist </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>number</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new optlist entry. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number</td><td>The option number (COAP_OPTION_*) </td></tr>
    <tr><td class="paramname">length</td><td>The option length </td></tr>
    <tr><td class="paramname">data</td><td>The option value data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the new optlist entry, or <code>NULL</code> if error </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00551">551</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="a11de99f50cc9f5a34fd9e4d121ecfd13" name="a11de99f50cc9f5a34fd9e4d121ecfd13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a11de99f50cc9f5a34fd9e4d121ecfd13">&#9670;&#160;</a></span>coap_opt_parse()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t coap_opt_parse </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td>
          <td class="paramname"><em>opt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__option__t.html">coap_option_t</a> *&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parses the option pointed to by <code>opt</code> into <code>result</code>. </p>
<p>This function returns the number of bytes that have been parsed, or <code>0</code> on error. An error is signaled when illegal delta or length values are encountered or when option parsing would result in reading past the option (i.e. beyond opt + length).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">opt</td><td>The beginning of the option to parse. </td></tr>
    <tr><td class="paramname">length</td><td>The maximum length of <code>opt</code>. </td></tr>
    <tr><td class="paramname">result</td><td>A pointer to the <a class="el" href="structcoap__option__t.html" title="Representation of CoAP options.">coap_option_t</a> structure that is filled with actual values iff <a class="el" href="option_8h.html#a11de99f50cc9f5a34fd9e4d121ecfd13" title="Parses the option pointed to by opt into result.">coap_opt_parse()</a> &gt; 0. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes parsed or <code>0</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00046">46</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="a683c0121b4028a90f612809437aaa3d0" name="a683c0121b4028a90f612809437aaa3d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a683c0121b4028a90f612809437aaa3d0">&#9670;&#160;</a></span>coap_opt_size()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t coap_opt_size </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td>
          <td class="paramname"><em>opt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the size of the given option, taking into account a possible option jump. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">opt</td><td>An option jump or the beginning of the option. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes between <code>opt</code> and the end of the option starting at <code>opt</code>. In case of an error, this function returns <code>0</code> as options need at least one byte storage space. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00321">321</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="a4225eb8945afcd42e9d4c50bd7c85ff1" name="a4225eb8945afcd42e9d4c50bd7c85ff1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4225eb8945afcd42e9d4c50bd7c85ff1">&#9670;&#160;</a></span>coap_option_filter_op()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int coap_option_filter_op </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>filter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="option_8c.html#a2e47362612316659297d3c87fb779187">filter_op_t</a>&#160;</td>
          <td class="paramname"><em>op</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Applies <code>op</code> on <code>filter</code> with respect to <code>type</code>. </p>
<p>The following operations are defined:</p>
<p>FILTER_SET: Store <code>type</code> into an empty slot in <code>filter</code>. Returns <code>1</code> on success, or <code>0</code> if no spare slot was available.</p>
<p>FILTER_CLEAR: Remove <code>type</code> from filter if it exists.</p>
<p>FILTER_GET: Search for <code>type</code> in <code>filter</code>. Returns <code>1</code> if found, or <code>0</code> if not found.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filter</td><td>The filter object. </td></tr>
    <tr><td class="paramname">type</td><td>The option type to set, get or clear in <code>filter</code>. </td></tr>
    <tr><td class="paramname">op</td><td>The operation to apply to <code>filter</code> and <code>type</code>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 on success, and 0 when FILTER_GET yields no hit or no free slot is available to store <code>type</code> with FILTER_SET. </dd></dl>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00474">474</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="a2be7abc95dd3dfc1f1f3f4268ce41101" name="a2be7abc95dd3dfc1f1f3f4268ce41101"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2be7abc95dd3dfc1f1f3f4268ce41101">&#9670;&#160;</a></span>is_long_option()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int is_long_option </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true iff <code>type</code> denotes an option type larger than 255. </p>

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00449">449</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="a70fa9db0450134640b80cbf7c3720688" name="a70fa9db0450134640b80cbf7c3720688"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70fa9db0450134640b80cbf7c3720688">&#9670;&#160;</a></span>opt_finished()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int opt_finished </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> *&#160;</td>
          <td class="paramname"><em>oi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00145">145</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
<a id="ad773b314b1ac7591f38f7b4b04d9e68d" name="ad773b314b1ac7591f38f7b4b04d9e68d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad773b314b1ac7591f38f7b4b04d9e68d">&#9670;&#160;</a></span>order_opts()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int order_opts </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="option_8c_source.html#l00573">573</a> of file <a class="el" href="option_8c_source.html">option.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="option_8c.html">option.c</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
